#include "comm.hpp"
int main()
{
    umask(0);
    mkfifo(FIFO_FILE,0664);
    int f1 = open("hhh",O_RDONLY);
    if(f1 < 0)
    {
        std::cout << "error" << std::endl;
        exit(1);
    }
    int f2 = open(FIFO_FILE,O_WRONLY);
    if(f1 < 0)
    {
        std::cout << "error" << std::endl;
        exit(1);
    }
    std::cout << 1 << std::endl;
    char buffer[1024] = {0};
    pid_t n = read(f1,buffer,sizeof(buffer) - 1);
    std::cout << 2 << std::endl;
    std::cout << buffer << std::endl;
    if(n > 0)
    {
        int ret = write(f2,buffer,sizeof(buffer));
        std::cout << 3 << std::endl;
    }
    close(f1);
    close(f2);
    return 0;
}